﻿using System.Configuration;
using EPiServer.DataAbstraction;
using EPiSugar.UnitTesting;
using NUnit.Framework;

namespace EPiSugar.Tests
{
    [TestFixture]
    public abstract class FakingEPiServerTests
    {
        [TestFixtureSetUp]
        public virtual void TestFixtureSetUp()
        {
            Fakes.Initialize(new FakeStructureBuilder());

            var config = ConfigurationManager.GetSection("epiSugar") as Configuration.EPiSugarSection;
            if(config != null)
            {
                var pageTypes = PageType.List();
                Current.Initialize(config, pageTypes, Fakes.CurrentPageProvider);
            }
        }
    }
}
